Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Major update of ESLint config aligned with htmlacademy/codeguide#75.
Breaking Changes
.eslintrc)"type": "module")es5,es5.5,es6(rules merged intovanilla)index.jsis now a barrel re-export, not a depends listDependencies
eslint(peer)>=7>=10eslint(dev)8.48.0^10.2.0typescript(peer)>=5@eslint/js^10.0.0@stylistic/eslint-plugin^5.10.0@eslint-react/eslint-plugin^4.2.0eslint-plugin-check-file2.6.2^3.3.0eslint-plugin-n^17.24.0eslint-plugin-unicorn46.0.0^64.0.0typescript-eslint^8.58.0eslint-plugin-node^11.1.0eslint-plugin-react^7.32.2ESLint Rules
vanilla.jsRules from removed
es5.js/es5.5.js/es6.jsmerged in:guard-for-in,no-caller,no-eval,no-extend-native,no-extra-bind,no-implied-eval,no-invalid-this,no-iterator,no-labels,no-lone-blocks,no-multi-str,no-new,no-new-func,no-new-wrappers,no-octal-escape,no-proto,no-script-url,no-sequences,no-throw-literal,no-with,consistent-return,max-nested-callbacks,yoda.New
prefer-rest-params— use rest params instead ofargumentsprefer-spread— use spread syntax instead of.apply()no-object-constructor— disallowsnew Object()(replaces deprecatedno-new-object)object-shorthand: ['error', 'always', {avoidQuotes: true}]— enforces shorthandproperties/methods in object literals, except when the key requires quoting
@stylistic/function-call-spacing: ['error', 'always']— requires space before callparentheses:
fn ()instead offn()(HTML Academy convention)@stylistic/generator-star-spacing: ['error', 'after']—function* gen()style@stylistic/rest-spread-spacing— no space after rest/spread operator@stylistic/yield-star-spacing: ['error', 'after']—yield* expressionstyle@stylistic/no-floating-decimal— requires leading zero:0.5instead of.5@stylistic/comma-style— comma at the end of the line, not the beginning@stylistic/computed-property-spacing— no spaces inside computed property brackets@stylistic/key-spacing— consistent spacing around colon in object keys@stylistic/keyword-spacing— space before/after keywords (if,else,return, etc.)@stylistic/lines-between-class-members— blank line between class members (exceptafter single-line members)
@stylistic/no-extra-semi— no unnecessary semicolonsModified
comma-dangle'only-multiline''always-multiline'quotes{allowTemplateLiterals: true}{allowTemplateLiterals: 'always'}Removed
valid-jsdoc— deprecated in ESLint, removedno-new-object— replaced byno-object-constructorlinebreak-style— removedno-process-exit— moved tonode.jsconfig scope onlynode.jsModified
node/*→n/*eslint-plugin-nodeeslint-plugin-n@typescript-eslint/no-shadow'error'['error', {hoist: 'all'}]Cleaned up: removed 12 disabled/off rules that provided no value (
node/no-exports-assign,node/exports-style,node/no-sync,node/no-process-env, etc.)react.jsPlugin replacement:
react/*→@eslint-react/*, JSX formatting →@stylistic/jsx-*.react/no-array-index-key@eslint-react/no-array-index-keyreact/no-access-state-in-setstate@eslint-react/no-access-state-in-setstatereact/jsx-no-useless-fragment@eslint-react/no-useless-fragmentreact/jsx-closing-bracket-location@stylistic/jsx-closing-bracket-locationreact/jsx-closing-tag-location@stylistic/jsx-closing-tag-locationreact/jsx-curly-newline@stylistic/jsx-curly-newlinereact/jsx-wrap-multilines@stylistic/jsx-wrap-multilinesRemoved
react/no-unused-prop-types— not available in@eslint-reactreact/jsx-boolean-value— not available in@eslint-reactreact-typescript.jsUses
tseslint.configs.recommendedTypeChecked+eslintReact.configs['recommended-type-checked']instead of manual extends.
Modified
@typescript-eslint/no-shadow'error'['error', {hoist: 'all'}]@typescript-eslint/no-unused-vars['error']['error', {args: 'after-used', argsIgnorePattern: '^_'}]Removed
@typescript-eslint/member-delimiter-style— handled by@stylisticreact/jsx-uses-react: 'off'— not needed in@eslint-reactreact/react-in-jsx-scope: 'off'— not needed in@eslint-react